<template>
  <template v-if="data.type.indexOf('range') != -1">
    <el-form-item label="开始占位内容" label-width="110px">
      <el-input v-model="data.startPlaceholder" clearable placeholder="开始占位内容"></el-input>
    </el-form-item>
    <el-form-item label="结束占位内容" label-width="110px">
      <el-input v-model="data.endPlaceholder" clearable placeholder="结束占位内容"></el-input>
    </el-form-item>
  </template>
  <el-form-item label="占位内容" v-else>
    <el-input v-model="data.placeholder" clearable placeholder="占位内容"></el-input>
  </el-form-item>
  <el-form-item label="显示格式化" label-width="100px">
    <el-input v-model="data.format" clearable placeholder="显示格式化"></el-input>
  </el-form-item>
  <el-form-item label="值格式化">
    <el-input v-model="data.valueFormat" clearable placeholder="值格式化"></el-input>
  </el-form-item>

  <div v-if="data.mode !== '2'">

    <el-form-item label="最小值">
      <el-input size="small" v-model="data.minDate" placeholder="最小值"></el-input>
    </el-form-item>
    <el-form-item label="最大值">
      <el-input size="small" v-model="data.maxDate" placeholder="最大值"></el-input>
    </el-form-item>
  </div>

  <div   v-if="['time'].includes(data.type)">

    <el-form-item label="步长">
      <el-input size="small" v-model="data.step" placeholder="步长"></el-input>
    </el-form-item>
    <el-form-item label="开始">
      <el-input size="small" v-model="data.start" placeholder="开始"></el-input>
    </el-form-item>
    <el-form-item label="结束">
      <el-input size="small" v-model="data.end" placeholder="结束"></el-input>
    </el-form-item>
  </div>

  <el-form-item
    label="取消范围联动"
    label-width="110px"
    v-if="['timerange', 'daterange', 'datetimerange'].includes(data.type)"
  >
    <el-switch v-model="data.unlinkPanels"></el-switch>
  </el-form-item>
</template>

<script>
  import mixinDate from '../mixins/date'
export default {
  name: "config-date",
  props: ['data'],
  components: {
    mixinDate
  },
}
</script>
